#!/bin/bash

set -xe

if [ "$#" -ne "2" ]; then  
    echo "usage: $0 <env-name> <namespace>"  
    exit 2
fi

KS_WORKSPACE="/usr/local/kubeflow_ks_app"
KS_ENV_NAME=${1}
KS_ENV_NAMESPACE=${2}

cd ${KS_WORKSPACE}

ks env list

ks env add ${KS_ENV_NAME}

ks env set ${KS_ENV_NAME} --namespace ${KS_ENV_NAMESPACE}

ks apply ${KS_ENV_NAME} -c kubeflow-core

exit 0